//
//  ZLCalendarSaleDetailSectionHeaderView.swift
//  TestDemo
//
//  Created by ayin on 2019/5/29.
//  Copyright © 2019 aYin. All rights reserved.
//  日历-发售详情-表区头

import UIKit

class ZLCalendarSaleDetailSectionHeaderView: UITableViewHeaderFooterView {
    //MARK: - 声明属性
    //内容view
    lazy var containView: UIView = {
        let view = UIView()
        view.backgroundColor = UIColor.white
        return view
    }()
    
    //标题
    lazy var titleLB: UILabel = {
        let label = UILabel.makeLabel(font: UIFont.pingfangSemibold(size: 18.up), text: nil, textColor: UIColor.fc1, numberLine: 1, alignment: .left)
        return label
    }()
    
    let hSpace: CGFloat = 15
    
    //MARK: - 初始化
    override init(reuseIdentifier: String?) {
        super.init(reuseIdentifier: reuseIdentifier)
        self.backgroundColor = UIColor.bg3
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
    
    class func reuseId() -> String {
        return self.className()
    }
    
    //MARK: - 搭建UI
    func setupUI(){
        self.addSubview(containView)
        containView.addSubview(titleLB)
        
        containView.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(10)
            make.right.left.bottom.equalToSuperview()
        }
        
        titleLB.snp.makeConstraints { (make) in
            make.left.equalToSuperview().offset(hSpace)
            make.top.bottom.equalToSuperview()
            make.right.equalToSuperview().offset(-hSpace)
        }
    }
    
    //MARK: - 刷新数据
    func refreshDatas(title: String) {
       titleLB.text = title
    }
}
